package com.py.framework.core.rest.support.jsonserializer;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import org.springframework.stereotype.Component;

import java.io.IOException;

/**
 * Created by hadoop on 2015/10/22.
 */
@Component
public class JsonLongSerializer extends JsonSerializer<Long> {

    @Override
    public void serialize(Long value, JsonGenerator gen, SerializerProvider provider)
            throws IOException, JsonProcessingException {

        String out = String.valueOf(value);

        gen.writeString(out);
    }

}